package com.hilihili.util;


/**
 * @author machi
 * @date 2023/12/05
 */
public class DataFormatUtil {
    private DataFormatUtil() {
    }

    public static String numChange(Long num) {
        if (num == null) {
            return "";
        }
        if (num >= 10000) {
            double n1 = Math.floor(num / 10000);
            double n2 = Math.floor((num % 10000) / 1000);
            if (n2 == 0) {
                return (int) n1 + "万";
            } else {
                return (int) n1 + "." + (int) n2 + "万";
            }
        } else {
            return num + "";
        }
    }

}
